package cn.wonderland.fallback;

import cn.wonderland.domain.User;
import cn.wonderland.feign.client.UserFeignClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFallBackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {
        throwable.printStackTrace();
        return id -> new User(-1L,"进入熔断降级！！",null,null);
    }
}
